#include "hd.h"

void lcd_init(void)
{
    LCDCRA=(1<<LCDBL);//lcd blanking enable
    LCDCRA=0X00;//LCD disable
    LCDCRB=(1<<LCDMUX1)|(1<<LCDMUX0);
    //1/3bias 1/4duty seg0 to seg12 is used as lcd
    LCDFRR=(1<<LCDCD2)|(1<<LCDCD1)|(1<<LCDCD0)|(1<<LCDPS2)|(1<<LCDPS1);
    //using 2048 as prescaler selection and 8 as lcd clock divide gives a frame rate of 54.3HZ
    LCDCCR=(1<<LCDCC2);
    //set segment drive time to 300us and output voltage to 2.80v
    LCDCRA=(1<<LCDEN)|(1<<LCDAB)|(1<<LCDBD);
    //enable lcd default waveform and no interrupt enabled/ low power waveform enabled/ lcd buffer(current) disable
}
